package edu.sctu.practice.class02.shuqiqi.assign.assign03.One;

import edu.sctu.practice.class02.shuqiqi.assign.assign03.One.GeometricObject;

/**
 * Created by admin on 2015/10/22.
 */
public class Rectangle extends GeometricObject {
    int wide;
    int height;

    public Rectangle(String color, int wide, int height) {
        super("blue");
        this.height = height;
        this.wide = wide;
    }

    @Override
    public void findArea() {
        area = wide * height;
        System.out.println(" 面积：" + area);
    }

    @Override
    public void findPerimeter() {
        Perimeter = 2 * (wide + height);
        System.out.println("周长： " + Perimeter);
    }

    public String toString() {
        return "宽" + wide + "\n高：" + height;
    }
}
